TakeVideo

Definition:

TakeVideo(datasource, field)

or

TakeVideo("vdatasource,pdatasource", "vfield,pfield")

 

Description:

Allow the user to record a video using the device's built-in camera.

Android & Windows Universal Platforms:

On these Platforms use the first definition given above.

iOS Platforms:

On iOS Platforms, the user can, optionally, also take a still photo whilst recording the video. If you want to allow the user to take a still photo you will need to use the second definition given above. If you don't want to allow the user to take a still photo, use the first definition given above instead.

Windows Desktop Platform:

On this Platform use the first definition given above. You cannot actually record a video on this Platform, instead the user will be able to import an existing video from the device's file system.

 

Platforms:

All

 

Parameters:

datasource - required

This parameter is only relevant when using the first definition given above.

Name of Data Source as defined within your Project in which to save the video.

This method can only be used with database Data Sources and this parameter must include the name of the Data Source and the table containing the field in which the video will be saved, in the format:

<datasourcename>.<tablename>

Click here for more information about the format of this parameter.

 

field - required

This parameter is only relevant when using the first definition given above.

Name of the field within the Data Source in which to store the video. See Notes below for information on data types supported.

 

vdatasource - required

This parameter is only relevant when using the second definition given above.

Name of Data Source as defined within your Project in which to save the video.

This method can only be used with database Data Sources and this parameter must include the name of the Data Source and the table containing the field in which the video will be saved, in the format:

<datasourcename>.<tablename>

Click here for more information about the format of this parameter.

 

pdatasource - required

This parameter is only relevant when using the second definition given above.

Name of Data Source as defined within your Project in which to save the still photo.

This method can only be used with database Data Sources and this parameter must include the name of the Data Source and the table containing the field in which the photo will be saved, in the format:

<datasourcename>.<table name>

Click here for more information about the format of this parameter.

 

vfield - required

Name of the field within the Data Source in which to store the video. See Notes below for information on data types supported.

 

pfield - required

Name of the field within the Data Source in which to store the still photo. See Notes below for information on data types supported.

 

Returns:

0

Video not recorded.

 

1

Video recorded.

 

2

Video recorded and still photo taken.

 

Notes:

  • The operation of TakeVideo can be altered using the following options available with the SetApplicationOption Method:

    CAMERA_TYPE - Only relevant to iOS devices, allows you to specify that calls to TakeVideo should do one of the following:

    • Present the user with the device's native camera app to allow them to record a video (option set to "NATIVE"),

    • Present the user with the enhanced camera built into the Digitise Apps Client to record a video (option set to "BUILTIN"),

    • Present the user with a standard picture browser allowing them to import an existing video from the device's video store (option set to "GALLERY")

      or

    • Give the user the choice of which of the above actions they want to perform (option set to "CHOOSE").

    VIDEO_HAS_AUDIO - Only relevant to the UWP Platform, allows you to enable and disable sound recording when recording a video.

     

    VIDEO_RESOLUTION - allows you to specify the resolution at which you want videos to be recorded. At runtime, if the resolution specified isn't supported by the device, the nearest available resolution below that specified will be used.

    Note that this option is only relevant on Android devices and will be ignored on iOS, Windows Universal and Windows Desktop Platforms.

    The default value, if this option isn't set specifically, is "SMALL", which equates to "QVGA" (320x240).

     

    VIDEO_TIMEOUT - allows you to specify a maximum time, in seconds, for which a video can be recorded to help reduce the size of recorded videos. The default time, if this option isn't set specifically, is 60 seconds.

    This option is not supported on Android and there is no default timeout on this Platform.

    This option is not relevant on the Windows Desktop Platform as you cannot record videos on this Platform.

     

  • If the user accepts the video then the video is placed into the specified field of the current record of the specified Data Source.

    To display the video on the current form, you need to have a Picture & Video Control on the form set for use with videos and input mapped to the specified field. You will then need to call RefreshControls to update the control with your new video.

  • To save the video, you MUST call UpdateCurrentRecord to save the record to the local database before moving to a different record.

  • The Data Source field(s) can have a data type of image, binary or varbinary.

  • The video will be saved in MP4 format.

  • When recording videos, the Data Source field specified to store the video must be configured to store its data to file rather than directly in the local database. When you need to refer to the video, e.g. within your Scripts or to create input and output mappings, you still refer to the Data Source field within the database and Digitise Apps keeps track of the file(s) used to store your video(s) behind the scenes.


See also:

SetApplicationOption

TakePhoto